package edu.gatech.cc.concolic.constraint;


public class NOT implements Constraint {

	private static final long serialVersionUID = 5658394737222458263L;

	protected final Constraint constraint;	
	
	public NOT(Constraint c) {
		this.constraint = c;
	}

	public Constraint constraint() {
		return constraint;
	}
	
	public String toString() {
		return String.format("(not %s)", constraint);
	}
	
	public int hashCode() {
		int result = 37;
		result = 37 * result + constraint.hashCode();
		return result;
	}
		
	public boolean equals(Object o) {
		if((!(o instanceof NOT))) return false;
		
		NOT other = (NOT) o;
		return constraint.equals(other.constraint);
	}
	
	public void accept(ConstraintVisitor visitor) {
		visitor.visit(this);
	}

}
